home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / lilo < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.3 KB  |  61 lines

  1. # bash completion for lilo(8)
  2.  
  3. have lilo && {
  4. _lilo_labels()
  5. {
  6.     COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \
  7.         /etc/lilo.conf | sed -e 's/\"//g' )" -- "$cur" ) )
  8. }
  9.  
  10. _lilo()
  11. {
  12.     local cur prev
  13.  
  14.     COMPREPLY=()
  15.     _get_comp_words_by_ref cur prev
  16.  
  17.     case $prev in
  18.         -C|-i|-m|-s|-S)
  19.             _filedir
  20.             return 0
  21.             ;;
  22.         -r)
  23.             _filedir -d
  24.             return 0
  25.             ;;
  26.         -I|-D|-R)
  27.             # label completion
  28.             _lilo_labels
  29.             return 0
  30.             ;;
  31.         -A|-b|-M|-u|-U)
  32.             # device completion
  33.             cur=${cur:=/dev/}
  34.             _filedir
  35.             return 0
  36.             ;;
  37.         -T)
  38.             # topic completion
  39.             COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= \
  40.                 table= video' -- "$cur" ) )
  41.             return 0
  42.             ;;
  43.     esac
  44.  
  45.     if [[ "$cur" == -* ]]; then
  46.         # relevant options completion
  47.         COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m \
  48.             -M -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) )
  49.     fi
  50. }
  51. complete -F _lilo lilo
  52. }
  53.  
  54. # Local variables:
  55. # mode: shell-script
  56. # sh-basic-offset: 4
  57. # sh-indent-comment: t
  58. # indent-tabs-mode: nil
  59. # End:
  60. # ex: ts=4 sw=4 et filetype=sh
  61.